{{ with .Site.Params.coverImage }}
  {{ if (in . "://") }}
    <div id="cover" style="background-image:url('{{ . | absURL }}');"></div>
  {{ else }}
    {{ if (fileExists (printf "static/images/%s" .)) }}
      {{ $cover := (printf "images/%s" .) }}
      <div id="cover" style="background-image:url('{{ $cover | absURL }}');"></div>
    {{ else }}
      <div id="cover" style="background-image:url('{{ . | absURL }}');"></div>
    {{ end }}
  {{ end }}
{{ end }}
